package HighLevelFunction

import scala.collection.immutable
import scala.collection.parallel.immutable.ParSeq

object Parallel {
  def main(args: Array[String]): Unit = {
    //串行计算
//    val strings: immutable.IndexedSeq[String] = (1 to 100).map(
//      x => Thread.currentThread().getName
//    )
//    println(strings)
    //并行计算
    val strings1: ParSeq[Long] = (1 to 10000).par.map(
      x => Thread.currentThread().getId
    )
    println(strings1)
  }

}
